package com.lelouch.dao;

import com.lelouch.bean.SysDept;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysDeptMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysDept record);

    int insertSelective(SysDept record);

    SysDept selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysDept record);

    int updateByPrimaryKey(SysDept record);

    List<SysDept> getAllDept();

    List<SysDept> getChildDeptListByLevel(@Param("level") String level);

    void batchUpdateLevel(@Param("sonDepts") List<SysDept> sonDepts);

    int countByNameAndParentId(@Param("parentId") Integer parentId, @Param("deptName") String deptName,
                   @Param("deptId") Integer deptId);
    int countByParentId(@Param("parentId") Integer parentId);
}